home *** CD-ROM | disk | FTP | other *** search
- Path: news.ssnet.com!not-for-mail
- From: helie@ssnet.com (Ray Helie)
- Newsgroups: comp.lang.c++
- Subject: Re: Virtual Members: Difficult Question
- Date: 22 Jan 1996 00:40:01 -0500
- Organization: SSNet, Inc.
- Message-ID: <4dv7vh$2as@marlin.ssnet.com>
- References: <4dmha6$80c@marlin.ssnet.com> <4dpbv2$l6k@colossus.holonet.net>
- NNTP-Posting-Host: marlin.ssnet.com
-
- Russell Blackadar <russell@news.mdli.com> wrote:
-
- - : void func1 (CObject* pItem)
- - : {
- - : C_BASE* base;
- - : base = pItem;
- - ???????????? ILLEGAL
- - You should get a compile error on this stmt. No automatic
- - conversion exists from a base pointer to a derived pointer.
-
- Actually, you're right-- I do cast in my progam but left it
- out of my posting in haste..
-
-
- - : On to the difficult part:
- - [...]
- - : I'm reading and writing object states to disk...
- -
- - Oh boy, I smell trouble. Are you expecting to use objects
- - saved from a previous run, for example? The vtbl pointers
- - (and any other pointers) will be all wrong. This is the
- - classic problem of "persistent objects" which requires a
- - very careful solution.
-
- Do you (or anyone) know of any such safe solution?
-
-
- Thank you for the insights.
-
- Ray [helie@ssnet.com]
-
-